﻿namespace ObjectsIdentity
{
    class Foo : object
    {
        int value;
        public Foo(int value)
        {
            this.value = value;
        }

        public override bool Equals(object obj)
        {
            Foo otherFoo = obj as Foo;
            if (otherFoo == null)
                return false;
            return this.value.Equals(otherFoo.value);
        }

        public override int GetHashCode()
        {
            return this.value;
        }
    }
}
